﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" x:Class="TrailMap.Controls.DrawTrack"
    mc:Ignorable="d"
    d:DesignHeight="321" d:DesignWidth="407" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
    <UserControl.Resources>
        <DataTemplate x:Key="InputTrkDataTemplate">
            <Border>
            <Label Content="{Binding name}" ToolTipService.ToolTip="{Binding cmt}"/>
            </Border>
        </DataTemplate>
        
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource trkDataSource}}">
    	<TabControl x:Name="mainTab" HorizontalAlignment="Left" Width="407" Height="321" VerticalAlignment="Top" SelectionChanged="TabControl_SelectionChanged">
    		<TabItem Header="Edit Tracks">
    			<Grid Background="#FFE5E5E5">
    				<Grid Margin="8,8,0,8" HorizontalAlignment="Left" Width="183">
    					<Button x:Name="bttnInputAdd" Content="..." Height="21" Margin="148,5,5,0" VerticalAlignment="Top" RenderTransformOrigin="0.583,0.423" Click="bttnInputAdd_Click" />
                        <!--<ListBoxDragDropTarget AllowDrop="True" Margin="0,30,0,0" d:LayoutOverrides="HorizontalAlignment" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"  >
    						<ListBox x:Name="listOfInputTracks" ItemsSource="{Binding Mode=OneWay}" ItemTemplate="{StaticResource InputTrkDataTemplate}" SelectionMode="Extended" />
    					</ListBoxDragDropTarget>-->
    					<TextBlock Height="20" Margin="4,4,82,0" TextWrapping="Wrap" Text="Input Tracks:" VerticalAlignment="Top"/>
    				</Grid>
    				<Grid Margin="221,8,0,8" HorizontalAlignment="Left" Width="168">
    					<Button x:Name="bttnOutputNew" Content="+" Height="21" VerticalAlignment="Top" HorizontalAlignment="Left" Width="22" Margin="140,6,0,0" Click="bttnOutputNew_Click" />
                        <!--<ListBoxDragDropTarget Margin="0,30,0,0" d:LayoutOverrides="HorizontalAlignment" AllowDrop="True" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
    						<ListBoxDragDropTarget.Resources>
    							<DataTemplate x:Key="OutputTrkDataTemplate">
    								<Border>
    									<sdk:Label Content="{Binding name}" ToolTipService.ToolTip="{Binding cmt}"/>
    								</Border>
    							</DataTemplate>
    						</ListBoxDragDropTarget.Resources>
    						<ListBox x:Name="listOfOutputTracks"  ItemTemplate="{StaticResource OutputTrkDataTemplate}" SelectionMode="Extended">
    							<ContextMenuService.ContextMenu>
    								<ContextMenu>
    									<MenuItem x:Name="trackPointEditMenuItem" Header="Edit This Track" Click="EditMenuItem_Click"/>
    									<MenuItem x:Name="trackPointStopEditMenuItem"  Header="Stop Edit" Click="StopEditMenuItem_Click" Visibility="Collapsed"/>
                                        <MenuItem x:Name="trackPlotThisMenuItem"  Header="Plot This" Click="trackPlotThisMenuItem_Click"/>
    								</ContextMenu>
    							</ContextMenuService.ContextMenu>
    						</ListBox>
    					</ListBoxDragDropTarget>-->
    		
    					<TextBlock Height="17" Margin="5,5,65,0" TextWrapping="Wrap" Text="Output Tracks:" VerticalAlignment="Top"/>
    				</Grid>
                    <Button Content="&gt;" Height="26" Margin="197,38,0,0" Name="bttnMoveTrackLeft" RenderTransformOrigin="0.583,0.423" VerticalAlignment="Top" Click="bttnMoveTrackLeft_Click" HorizontalAlignment="Left" Width="18" />
                    <Button Content="&lt;" Height="26" Margin="197,0,0,188" Name="bttnMoveTrackRight" RenderTransformOrigin="0.583,0.423" VerticalAlignment="Bottom" Click="bttnMoveTrackRight_Click" HorizontalAlignment="Left" Width="18" />
                </Grid>
    		</TabItem>
    		<TabItem Header="Edit Waypoints">
    			<Grid Background="#FFE5E5E5">
    				<Grid Margin="8,8,0,8" HorizontalAlignment="Left" Width="179">
    					<Button x:Name="bttnInputWaypointsAdd" Content="..." Height="21" Margin="144,4,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.583,0.423" Click="bttnInputWaypointsAdd_Click" HorizontalAlignment="Left" Width="29" />
                        <!--<ListBoxDragDropTarget AllowDrop="True" Margin="0,28,0,0" d:LayoutOverrides="HorizontalAlignment" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"  >
    						<ListBox x:Name="listOfInputWaypoints" ItemsSource="{Binding Mode=OneWay}" ItemTemplate="{StaticResource InputTrkDataTemplate}" SelectionMode="Extended" />
    					</ListBoxDragDropTarget>-->
    					<TextBlock Height="20" Margin="4,4,43,0" TextWrapping="Wrap" Text="Input Waypoints:" VerticalAlignment="Top"/>
    				</Grid>
    				<Grid Margin="219,8,0,8" HorizontalAlignment="Left" Width="170">
                        <!--<ListBoxDragDropTarget Margin="0,28,0,0" d:LayoutOverrides="HorizontalAlignment" AllowDrop="True" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
    						<ListBoxDragDropTarget.Resources>
    							<DataTemplate x:Key="OutputTrkDataTemplate">
    								<Border>
    									<Label Content="{Binding name}" ToolTipService.ToolTip="{Binding cmt}"/>
    								</Border>
    							</DataTemplate>
    						</ListBoxDragDropTarget.Resources>
    						<ListBox x:Name="listOfOutputWaypoints"  ItemTemplate="{StaticResource OutputTrkDataTemplate}" SelectionMode="Extended">
    						</ListBox>
    					</ListBoxDragDropTarget>-->
    		
    					<TextBlock Height="17" Margin="5,5,56,0" TextWrapping="Wrap" Text="Output Waypoints:" VerticalAlignment="Top"/>
    				</Grid>
                    <Button Content="&gt;" Height="26" Margin="193,36,0,0" Name="bttnMoveWaypointLeft" RenderTransformOrigin="0.583,0.423" VerticalAlignment="Top" Click="bttnMoveWaypointLeft_Click" HorizontalAlignment="Left" Width="20" />
                    <Button Content="&lt;" Height="26" Margin="193,0,0,190" Name="bttnMoveWaypointRight" RenderTransformOrigin="0.583,0.423" VerticalAlignment="Bottom" Click="bttnMoveWaypointRight_Click" HorizontalAlignment="Left" Width="20" />
                </Grid>
    		</TabItem>
    		<TabItem Header="Manage GPX">
    			<Grid Background="#FFE5E5E5">
    				<Button Content="Load GPX" Height="30" Margin="90,6,73,0" VerticalAlignment="Top" Name="bttnLoadGpxFile" Click="bttnLoadGpxFile_Click" />
    				<Button Content="Save As GPX" Height="30" Margin="90,42,73,0" VerticalAlignment="Top" Name="bttnSaveGPXFile" Click="bttnSaveGPXFile_Click" />
    				<Button Content="Plot Track Elevation Profile" Margin="90,0,73,173" Name="bttnPlotTrackElevation" Height="33" VerticalAlignment="Bottom" Click="bttnPlotTrackElevation_Click" />
    				<Button Content="Plot Waypoint Elevation Profile" Margin="90,0,73,130" Height="37" VerticalAlignment="Bottom" Name="bttnPlotWaypointElevation" Click="bttnPlotWaypointElevation_Click" />
    				<Button Content="Update Waypoint Elevation" Margin="90,0,73,89" Height="37" VerticalAlignment="Bottom" x:Name="bttnGetWaypointElevation" d:LayoutOverrides="VerticalAlignment" Click="bttnGetWaypointElevation_Click" />
    			</Grid>
    		</TabItem>
    	</TabControl>
    </Grid>
</UserControl>
